<template>
  <div class="user-info-card">
    <div class="user-avatar">
      <img src="/picture/管理员.png" alt="用户头像" class="user-avatar-img">
    </div>
    <div class="user-details">
      <h3 class="user-name">{{ userInfo.name }}</h3>
      <p class="user-role">{{ userInfo.role }}</p>
      <div class="user-stats">
        <div class="stat-item">
          <span class="stat-label">项目数</span>
          <span class="stat-value">{{ userInfo.projects }}</span>
        </div>
        <div class="stat-item">
          <span class="stat-label">测试用例</span>
          <span class="stat-value">{{ userInfo.testCases }}</span>
        </div>
        <div class="stat-item">
          <span class="stat-label">执行次数</span>
          <span class="stat-value">{{ userInfo.executions }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { reactive } from 'vue'

export default {
  name: 'UserInfoCard',
  setup() {
    const userInfo = reactive({
      name: '管理员',
      role: '系统管理员',
      projects: 12,
      testCases: 479,
      executions: 1234
    })

    return {
      userInfo
    }
  }
}
</script>

<style scoped>
.user-info-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.user-avatar {
  margin-right: 20px;
}

.user-avatar-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
}

.user-details h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.user-details p {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 15px;
}

.user-stats {
  display: flex;
  gap: 25px;
}

.stat-item {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 11px;
  opacity: 0.8;
  margin-bottom: 2px;
}

.stat-value {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .user-info-card {
    flex-direction: column;
    text-align: center;
  }
  
  .user-avatar {
    margin-right: 0;
    margin-bottom: 15px;
  }
}
</style>